package demo05;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author: WangPeng
 * @createTime: 2022/11/04 17:35
 * @description:
 * @version: v1.0
 */
public class Test03 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Collections.addAll(list, "张无忌", "周芷若", "赵敏", "张强", "张三丰");
        //通过集合对象调用stream方法获取
        Stream<String> stream = list.stream();

        //通过Arrays数组工具类调用stream方法。
        String [] arr={"aa","bb","cc"};
        Stream<String> stream1 = Arrays.stream(arr);

        //通过Stream类中的方法获取Stream流对象
        Stream<String> stream2 = Stream.of("aa", "bb", "cc");
    }
}
